package ldk.app.kotlinweibo.apis

import io.reactivex.Observable
import org.junit.Test

/**
 * Created by ldkxingzhe@163.com on 2017/6/29.
 */
class RxJavaTest {

    @Test
    fun test_concatMap(){
        Observable.just("10").concatMap { t ->
            System.out.print(t)
            Observable.just(t!!.toInt())
        }
    }

    @Test
    fun test_flatMap(){
        Observable.just("xyz")
                .concatMap { Observable.just(it.toInt()) }
                .concatMap { Observable.just(it.toString())}
                .subscribe({
                    System.out.print(it)
                }, {
                    System.out.println(it)
                })
    }
}